{template admin/head}
<script type="text/javascript">
var ajaxparam = {
		'url' : '{SITE_URL}/ajax/admin.php'
};
function deladmin(id,status,str)
{
	if(id)
	{
		
		layer.confirm('你确定执行'+str+'操作吗？', {
		  time: 0 //不自动关闭
		  ,btn: ['很确定', '点错了']
		  ,yes: function(index){
		    layer.close(index);
		    
		    
		    var url = ajaxparam.url + '?m=cpItemStatus';
			var data = {
					'id' : id,
					'status':status,
					'str':str,
			};
			var callback = function(data){
				if(data.sign == 1)
				{
					layer.alert(data.msg,function(){
						window.location = window.location;
					});
				}
				else
				{
					if(data.msg)
					{
						layer.msg(data.msg);
					}
					else
					{
						layer.msg('操作失败');
					}
				}
			};
			makeAjax('post',url,data,callback);
		    
		    
		    
		    
		    
		    
		    
		    
		  }
		});
		
		
		
		
	}else{
		alert('参数错误');
	}
}
</script>
<body>
<div class="wrapper">
	<div class="crumbs"><a href="javascript:;">产品管理</a> &gt;<a href="{SITE_URL}admin.php?a=chanpinM">产品列表</a> &gt; <span>{$chanpin[name]}产品项目列表</span> </div>
	
	<div class="container_tit clearfix mb20 ft14">
	
	<form action="{SITE_URL}admin.php?a={$action}" method="get">
		<input type="hidden" name="a" value="{$action}" />
		<input type="hidden" value='{$parm[m]}' name="m" />
		<input type="hidden" value='{$parm[pid]}' name="pid" />
        <div class="btn_box fl">
        	<span>项目名称</span>
        	<input type="text" id="keyword" name="keyword" class="mr15 w200 text" value="{$parm[keyword]}">
        </div>
        
        <div class="btn_box fl">
        	<input type="submit" name="submit" class="btnblue mr15" value="搜索">
        </div>
        
        <div class="btn_box fl">
        	<a href="{SITE_URL}admin.php?a={$action}&m=addCPitem&pid={$parm[pid]}" class="btnyellow mr15">添加项目</a>
        </div>
    </form>
    </div>
	
	<!-- list -->
	<table class="table">
		<thead>
			<tr class="bg_h_1">
				<th width="">序号(排序)</th>
				<th width="">项目名称</th>
				<th width="">链接地址</th>
				<th width="">投资期限</th>
				<th width="">返利类型</th>
				<th width="">比例/金额</th>
				<th width="">最后操作人</th>
				<th width="">最后操作时间</th>
				<th width="">最后操作内容</th>
				<th width="">状态</th>
            	<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
		<!--{loop $list $key $one}-->
			<tr>
				<td style="text-align: center;">{$one['sort']}</td>
				<td style="text-align: center;">{$one['name']}</td>
				<td style="text-align: center;">{$one['link']}</td>
				<td style="text-align: center;">{$one['qixian']}</td>
				<td style="text-align: center;">
					{if $one[type] == 1}
						比例
					{elseif $one[type] == 2}
						固定金额
					{/if}
				</td>
				<td style="text-align: center;">
					{if $one[type] == 1}
						{$one['fanli']}%
					{elseif $one[type] == 2}
						{$one['fanli']}元
					{/if}
				</td>
				<td style="text-align: center;">{$one['opinfo']['loginname']}</td>
				<td style="text-align: center;">{php echo time_formart($one['opinfo']['optime'],2)}</td>
				<td style="text-align: center;">{$one['opinfo']['opdesc']}</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						启用
					{elseif $one[status] == 2}
						禁用
					{/if}
				</td>
				<td style="text-align: center;">
					{if $one[status] == 1}
						<a class="btn_set" href="javascript:;" onclick="deladmin('{$one['id']}','2','禁用')"  title="禁用">禁用</a>
					{elseif $one[status] == 2}
						<a class="btn_set" href="javascript:;" onclick="deladmin('{$one['id']}','1','启用')"  title="启用">启用</a>
					{/if}
					
					<a class="btn_edit" href="{SITE_URL}admin.php?a={$action}&m=editCPitem&id={$one[id]}"  title="编辑">编辑</a>
				</td>
			</tr>
		<!--{/loop}-->
		</tbody>
	</table>
</div>

<!--{php pagenav($pageurl,$page,$pagetotal);}-->
{template admin/foot}